const router = require("koa-router")()
router.prefix("/app")
const { classifyList, libraryList, libraryDetailsById } = require('../services/app')
/**
* @swagger
* tags:
*   name: APP端接口管理
*   description: app management
*/
/**
 * @swagger
 * /app/classify/list:
 *   get:
 *     summary: 产品分类列表数据
 *     description: 根据分页信息查询产品分类数据，返回一个分类列表
 *     tags: [APP端接口管理]
 *     parameters:
 *       - name: pageNum
 *         description: 分页页数
 *         required: true
 *         in: query
 *         type: string
 *       - name: pageSize
 *         description: 分页条数
 *         in: query
 *         required: true
 *         type: string
 *     responses:
 *       '200':
 *         description: Ok
 *         schema:
 *           type: 'object'
 *           properties:
 *             code:
 *               type: 'number'
 *               description: 成功状态码
 *             data:
 *               type: 'object'
 *               description: 返回数据
 *             message:
 *               type: 'string'
 *               description: 消息提示
 *       '400':
 *         description: 操作失败
 *       '404':
 *         description: not found
 */
/**
 * @swagger
 * /app/library/list:
 *   get:
 *     summary: 产品列表数据
 *     description: 根据分页信息查询产品数据，返回一个产品列表
 *     tags: [APP端接口管理]
 *     parameters:
 *       - name: pageNum
 *         description: 分页页数
 *         required: true
 *         in: query
 *         type: string
 *       - name: pageSize
 *         description: 分页条数
 *         in: query
 *         required: true
 *         type: string
 *       - name: classifyId
 *         description: 分类ID
 *         in: query
 *         required: false
 *         type: string
 *     responses:
 *       '200':
 *         description: Ok
 *         schema:
 *           type: 'object'
 *           properties:
 *             code:
 *               type: 'number'
 *               description: 成功状态码
 *             data:
 *               type: 'object'
 *               description: 返回数据
 *             message:
 *               type: 'string'
 *               description: 消息提示
 *       '400':
 *         description: 操作失败
 *       '404':
 *         description: not found
 */

/**
 * @swagger
 * /app/library/details:
 *   get:
 *     summary: 产品详情数据
 *     description: 根据分页信息查询产品数据，返回一个产品列表
 *     tags: [APP端接口管理]
 *     parameters:
 *       - name: libraryId
 *         description: 产品ID
 *         required: true
 *         in: query
 *         type: string
 *     responses:
 *       '200':
 *         description: Ok
 *         schema:
 *           type: 'object'
 *           properties:
 *             code:
 *               type: 'number'
 *               description: 成功状态码
 *             data:
 *               type: 'object'
 *               description: 返回数据
 *             message:
 *               type: 'string'
 *               description: 消息提示
 *       '400':
 *         description: 操作失败
 *       '404':
 *         description: not found
 */
// 产品分类
router.get('/classify/list', classifyList) // 产品分类
// 产品库
router.get('/library/list', libraryList) // 根据分类ID，查询产品库
router.get('/library/details', libraryDetailsById) // 根据产品ID，查询产品详细数据

module.exports = router